% Making a movie 
load D:\Manoj\tsunami\Tsunami_Predicted_Feilds.mat;

hf=figure;
kk=1;
set(hf,'Position',[200   300   800   600]);
rect = get(hf,'Position'); 
mov = avifile('tsunami_Ep_000.avi','fps',5,'quality',100)
load D:\Manoj\tsunami\20080108\e_colormap my_map;

load coast

for i = 1:1:300,
    worldmap([-28.5,28.5],[30.5,120.5]);
    worldmap([-28.5,28.5],[30.5,120.5]);
    h=contourfm(flipud(squeeze(Et_t(i,:,:))),[1,28.5,30.5],30);
    caxis([0,10]);
    colormap(my_map);
    geoshow(lat, long, 'color','k')
    hp=colorbar;
    set(hp,'FontSize',16);
    text(.86,.55,'E_{\phi}','FontSize',16)
    title(['Electric Field  ' sprintf('%d Minutes',i) '  from Tsunami initiation'],'FontSize',16);
    F = getframe(hf);
    mov = addframe(mov,F);
    pause(0.05);
    hold off;
end;
mov = close(mov);
        
clear mex % clears all open avi files useful when sharing violation problem occurs  
